﻿/*
 * 2023/3/2
 * 简单的商品示例--SKU概念
 * 
 * **/
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH5_2008A.ShoppingCode.Domain
{
    [Table("tb_product")]
    public class TbProductEntity
    {
        public Guid Id { get; set; }
        public Guid? SPUId { get; set; }
        public string? Name { get; set; }
        public string? Description { get; set; }
        public int? CommentNumber { get; set; } //评论数  （会根据评论表里的数据而变化）
        public decimal? Price { get; set; } //原价
        public decimal? SalePrice { get; set; }//售价
        public int? Stock { get; set; }//库存
        public int? SaleNumber { get; set; } //销量（会根据订单数据而变化）
        public int? ValidStock { get; set; }//有效库存
        public int? LockStock { get; set; }//锁定库存
        public string? SpecColor { get; set; } //规格-颜色值
        public string? SpecSize { get; set; }//规格-尺寸
        public string? MasterImage { get; set; } //主图 （还会有一个图片关联表--多图）
        public bool? IsUp { get; set; } = true; //上下架，默认上架

        public string? Flag { get; set; } = "000000"; //标识位：从左到右：推荐、特价、专场、秒杀。。。。   111100
        public string? StoreName { get; set; } //店铺名称

        //审计字段
        public DateTime CreatedTime { get; set; } = System.DateTime.UtcNow;
        public DateTime? UpdatedTime { get; set; }
        public string? CreatedBy { get; set; }
        public string? UpdatedBy { get; set; }

        //导航属性
        //public List<TbProductImageEntity> tbProductImages { get; set; }
    }


    [Table("tb_product_image")]
    public class TbProductImageEntity
    {
        public Guid Id { get; set; }
        public Guid ProductId { get; set; } //关联产品(TbProductEntity表)的SKUId 
        public string? ImagePath { get; set; } //图片路径
    }
}
